package com.bulk.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 散装java
 */
@RestController
@Slf4j
public class IndexController {

    @GetMapping("/")
    public String root() {
        try {
            this.testException();
        } catch (Exception e) {
            log.info("出现异常 {}", e.toString());
        }
        return "项目启动成功！";
    }

    public void testException() {
        throw new RuntimeException("运行时异常");
    }
}
